//
//  ViewController.m
//  CardLayout
//
//  Created by 陈凯 on 2017/3/1.
//  Copyright © 2017年 陈凯. All rights reserved.
//

#import "MSAttendanceScreenController.h"
#import "CardLayOut.h"
#import "BQLSlideView.h"


@interface MSAttendanceScreenController () <UICollectionViewDataSource, UICollectionViewDelegate>
{
    CustomNavigationBar *naviagtionBar;
}
@property (nonatomic, strong) BQLSlideView *slideView;

@end

@implementation MSAttendanceScreenController
- (int)navBarBottom {
    if ([WRNavigationBar isIphoneX]) {
        return 88;
    } else {
        return 64;
    }
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
    
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self CreateNavigationBar];
    
    // Do any additional setup after loading the view, typically from a nib.
    NSArray *array = @[@"我是第一张",@"我是第二张",@"我是第三张",
                       @"我是第四张",@"我是第五张",@"我是第六张",
                       @"我是第七张",@"我是第八张",@"我是第九张"];
    _slideView = [BQLSlideView cardView:CGRectMake(0, 70, self.view.bounds.size.width, self.view.bounds.size.width)];
    [_slideView setCardViews:array atIndex:0];
    _slideView.transfrom = YES;
    [self.view addSubview:_slideView];
}



- (void)CreateNavigationBar{
    
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"登录bg"]];
    naviagtionBar = [[CustomNavigationBar alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, [self navBarBottom])];
    [self.view addSubview:naviagtionBar];
    naviagtionBar.backgroundColor = [UIColor clearColor];
    naviagtionBar.titleLabel.text = @"筛选";
    naviagtionBar.rightBtn.hidden = YES;
    naviagtionBar.rightBtnTitle.hidden = YES;
    [naviagtionBar.leftBtn setImage:[UIImage imageNamed:@"左箭头"] forState:UIControlStateNormal];
    [naviagtionBar.leftBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:naviagtionBar];
    
    //    [naviagtionBar.leftBtn setImage:[UIImage imageNamed:@"左箭头"] forState:UIControlStateNormal];
    //    [naviagtionBar.leftBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    
}
- (void)backClick{

    [self.navigationController popViewControllerAnimated:NO];
}
@end
